package com.hsoft.zhxy.app.xtgl_02_01.controller;

import com.alibaba.fastjson.JSONObject;
import com.hsoft.zhxy.app.xtgl_02_01.model.query.JcggCzrzQyery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;

import com.hsoft.zhxy.app.xtgl_02_01.service.JcggCzrzService;
import com.hsoft.zhxy.app.common.model.entity.JcggCzrz;

@Api(tags = "xtgl_02_01 操作日志")
@Log4j2
@Validated
@RestController
@RequestMapping(value = "/xtgl_02_01/jcggCzrz/", produces = "application/json;charset=UTF-8")
public class JcggCzrzController {

    @Autowired
    private JcggCzrzService jcggCzrzService;

    @ApiOperation(value = "查询单条数据", notes = "查询单条数据")
    @GetMapping("findOne")
    public JSONObject findOne(JcggCzrz jcggCzrz) {
        return jcggCzrzService.findOne(jcggCzrz);
    }


    @ApiOperation(value = "查询列表数据", notes = "查询列表数据")
    @GetMapping("findList")
    public JSONObject findList(JcggCzrz jcggCzrz) {
        return jcggCzrzService.findList(jcggCzrz);
    }
    
    
    @ApiOperation(value = "查询分页列表数据", notes = "查询分页列表数据")
    @PostMapping("findListByPage")
    public JSONObject findListByPage(@RequestBody JcggCzrzQyery jcggCzrzQyery) {
        log.debug(jcggCzrzQyery);
        return jcggCzrzService.findListByPage(jcggCzrzQyery);
    }
    
    
    @ApiOperation(value = "新增", notes = "新增")
    @PostMapping("add")
    public JSONObject add(@RequestBody @Valid JcggCzrz jcggCzrz) {
        return jcggCzrzService.add(jcggCzrz);
    }
    
    
    @ApiOperation(value = "修改", notes = "修改")
    @PostMapping("update")
    public JSONObject update(@RequestBody @Valid JcggCzrz jcggCzrz) {
        return jcggCzrzService.update(jcggCzrz);
    }

    @ApiOperation(value = "删除", notes = "删除")
    @PostMapping("delete")
    public JSONObject delete(@RequestBody JcggCzrz jcggCzrz) {
        return jcggCzrzService.delete(jcggCzrz);
    }
    
    
    // 各方法命名需要以 find、add、update、delete开头，遵循驼峰原则


}